package com.lagou.task15;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class CollectionsTest {
    public static void main(String[] args) {
        List<Integer> integers = Arrays.asList(1, 2, 3, 4, 5, 6);
        System.out.println("集合最大值= " + Collections.max(integers));
        System.out.println("集合最小值= " + Collections.min(integers));
        Collections.reverse(integers);
        System.out.println("集合反转= " + integers);
        //交换两个元素的位置
        Collections.swap(integers,1,4);
        System.out.println("集合元素=" + integers);
        Collections.sort(integers);
        System.out.println("集合元素=" + integers);
        Collections.shuffle(integers);
        System.out.println("集合元素=" + integers);
//        Collections.shuffle(integers);

    }
}
